package com.ssy.lingxi.order.model.vo.buyer.request;

import com.ssy.lingxi.order.handler.annotation.DeliverPeriodAnnotation;
import com.ssy.lingxi.order.model.vo.basic.request.OrderConsigneeVO;
import com.ssy.lingxi.order.model.vo.basic.request.OrderInvoiceVO;
import com.ssy.lingxi.order.model.vo.basic.request.OrderRequirementVO;
import com.ssy.lingxi.order.model.vo.basic.request.SrmOrderProductVO;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;

/**
 * 创建请购单订单接口参数VO
 * @author wyx
 * @version 2.0.0
 * @date 2021-11-04
 */
public class RequisitionOrderCreateVO implements Serializable {
    private static final long serialVersionUID = 2879491338231289483L;

    /**
     * 供应商会员Id
     */
    @NotNull(message = "供应商会员Id要大于0")
    @Positive(message = "供应商会员Id要大于0")
    private Long vendorMemberId;

    /**
     * 供应商会员角色Id
     */
    @NotNull(message = "供应商会员角色Id要大于0")
    @Positive(message = "供应商会员角色Id要大于0")
    private Long vendorRoleId;

    /**
     * 供应商会员名称
     */
    @NotBlank(message = "供应商会员名称不能为空")
    @Size(max = 200, message = "供应商会员名称最长200个字符")
    private String vendorMemberName;

    /**
     * 交付日期，格式为yyyy-MM-dd，或yyyy-MM-dd HH:mm，或yyyy-MM-dd HH:mm-HH:mm
     */
    @DeliverPeriodAnnotation
    private String deliverDate;

    /**
     * 请购单ID
     */
    @NotNull(message = "请购单ID不能为空")
    private Long requisitionId;

    /**
     * 请购单编号
     */
    @NotEmpty(message = "请购单编号不能为空")
    private String requisitionNo;

    /**
     * 订单摘要
     */
    @NotNull(message = "订单摘要不能为空")
    @Size(max = 100, message = "订单摘要最长100个字符")
    private String digest;

    /**
     * 收货地址
     */
    @NotNull(message = "收货地址不能为空")
    @Valid
    private OrderConsigneeVO consignee;

    /**
     * 是否有发票，true-有，false-无
     */
    @NotNull(message = "'是否有发票'字段不能为空")
    private Boolean hasInvoice;

    /**
     * 发票信息，如订单没有发票不需要填写此字段
     */
    @Valid
    private OrderInvoiceVO invoice;

    /**
     * 商品（物料）列表
     */
    @NotEmpty(message = "物料列表不能为空")
    @Valid
    private List<SrmOrderProductVO> products;

    /**
     * 订单其他要求。如订单没有其他要求不需要填写此字段
     */
    private OrderRequirementVO requirement;

    public Long getVendorMemberId() {
        return vendorMemberId;
    }

    public void setVendorMemberId(Long vendorMemberId) {
        this.vendorMemberId = vendorMemberId;
    }

    public Long getVendorRoleId() {
        return vendorRoleId;
    }

    public void setVendorRoleId(Long vendorRoleId) {
        this.vendorRoleId = vendorRoleId;
    }

    public String getVendorMemberName() {
        return vendorMemberName;
    }

    public void setVendorMemberName(String vendorMemberName) {
        this.vendorMemberName = vendorMemberName;
    }

    public String getDeliverDate() {
        return deliverDate;
    }

    public void setDeliverDate(String deliverDate) {
        this.deliverDate = deliverDate;
    }

    public Long getRequisitionId() {
        return requisitionId;
    }

    public void setRequisitionId(Long requisitionId) {
        this.requisitionId = requisitionId;
    }

    public String getRequisitionNo() {
        return requisitionNo;
    }

    public void setRequisitionNo(String requisitionNo) {
        this.requisitionNo = requisitionNo;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public OrderConsigneeVO getConsignee() {
        return consignee;
    }

    public void setConsignee(OrderConsigneeVO consignee) {
        this.consignee = consignee;
    }

    public Boolean getHasInvoice() {
        return hasInvoice;
    }

    public void setHasInvoice(Boolean hasInvoice) {
        this.hasInvoice = hasInvoice;
    }

    public OrderInvoiceVO getInvoice() {
        return invoice;
    }

    public void setInvoice(OrderInvoiceVO invoice) {
        this.invoice = invoice;
    }

    public List<SrmOrderProductVO> getProducts() {
        return products;
    }

    public void setProducts(List<SrmOrderProductVO> products) {
        this.products = products;
    }

    public OrderRequirementVO getRequirement() {
        return requirement;
    }

    public void setRequirement(OrderRequirementVO requirement) {
        this.requirement = requirement;
    }
}
